#!/bin/sh

# This script writes the paths of NH3D directiories to the .bash_profile in the user home directory $HOME

#paths_file=$HOME/.profile
paths_file=paths
#paths_file=$HOME/$1

nh3d_path=$(pwd)
rm -f $paths_file
echo "nh3d_path=$nh3d_path" >> $paths_file
echo "objfile_path=$nh3d_path/objfiles" >> $paths_file
echo "source_path=$nh3d_path/source" >> $paths_file
echo "radiation_path=$nh3d_path/source/radiation" >> $paths_file
echo "microphys_path=$nh3d_path/source/microphys" >> $paths_file
echo "chem_path=$nh3d_path/source/chem" >> $paths_file
echo "isba_path=$nh3d_path/source/isba" >> $paths_file
echo "lake_path=$nh3d_path/source/lake" >> $paths_file
echo "inmsoil_path=$nh3d_path/source/inmsoil" >> $paths_file
echo "inmsoil_interface_path=$nh3d_path/source/inmsoil_interface" >> $paths_file
echo "cmodel_path=$nh3d_path/source/cmodel" >> $paths_file
echo "nh3d_mpi_path=$nh3d_path/source/mpi" >> $paths_file
echo "module_path=$nh3d_path/modules" >> $paths_file

rm -f $nh3d_path/mkfls_profs/Makefile.in
cp $nh3d_path/mkfls_profs/Makefile0.in $nh3d_path/mkfls_profs/Makefile.in
#sed '$d' mkfls_profs/Makefile.in
echo "include $nh3d_path/$paths_file" >> mkfls_profs/Makefile.in

#echo "export objfile_path source_path nh3d_path radiation_path microphys_path chem_path \
#isba_path lake_path nh3d_mpi_path module_path inmsoil_path inmsoil_interface_path cmodel_path"  >> $paths_file
